package org.hamster.common.manager.pointcut.vo
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import org.hamster.common.manager.pointcut.IPointcutAsyncTarget;
	import org.hamster.common.manager.pointcut.events.PointcutEvent;

	public class PointcutVO extends EventDispatcher
	{
		private var _notification:String;
		
		public function set notification(value:String):void
		{
			_notification = value;
		}
		
		public function get notification():String
		{
			return _notification;
		}
		
		/**
		 * from PointCutTiming constants
		 */
		private var _timing:String;
		
		public function set timing(value:String):void
		{
			this._timing = value;
		}
		
		public function get timing():String
		{
			return this._timing;
		}
		
		private var _handler:Function;
		
		public function set handler(value:Function):void
		{
			this._handler = value;
		}
		
		public function get handler():Function
		{
			return this._handler;
		}
		
		private var _priority:int;
		
		public function get priority():int
		{
			return this._priority;
		}
		
		private var _asyncTarget:IPointcutAsyncTarget;
		
		public function get asyncTarget():IPointcutAsyncTarget
		{
			return _asyncTarget;
		}
		
		public function PointcutVO(notification:String, timing:String, handler:Function, asyncTarget:IPointcutAsyncTarget = null, priority:int = 0)
		{
			this.notification = notification;
			this.timing = timing;
			this.handler = handler;
			this._priority = priority;
			this._asyncTarget = asyncTarget;
		}
		
		public function next():void
		{
			this.dispatchEvent(new PointcutEvent(PointcutEvent.POINTCUT_NEXT, this));
		}
		
		public function cancel():void
		{
			this.dispatchEvent(new PointcutEvent(PointcutEvent.POINTCUT_CANCEL, this));
		}
	}
}